package com.zhijiaoyun.service;

import com.zhijiaoyun.model.Lesson;
import com.zhijiaoyun.model.dto.PageList;

import java.util.List;
import java.util.Map;

/**
 * @author shisfish
 * @date 2017/6/6
 */
public interface ILessonService {

    Lesson getLessonByName(String name);

    Map<String, Object> addLesson(Lesson lesson);

    Lesson getLessonByLessonId(Long lessonId);

    Lesson getLessonByNameCourseIdNotLessonId(Long lessonId, Long courseId, String name);

    Map<String, Object> modifyLesson(Lesson lesson);

    PageList<Lesson> pageByParams(Long courseId, Integer pageIndex, String name, String title);

    Lesson getLessonByNameCourseId(Long courseId, String name);

    List<Lesson> getLessonByCourseId(Long courseId);

    Lesson getLessonByLessonIdCourseId(Long lessonId, Long courseId);

    List<Lesson> getByParams(Long courseId, String name, String title);

    void deleteLesson(Lesson lesson);

    int countAll();

    /**
     * 课时详情
     *
     * @param lessonId
     * @return
     */
    Map<String, Object> getLessonById(Long lessonId);

    /**
     * 条件查询课时列表
     *
     * @param courseId
     * @param name
     * @param title
     * @return
     */
    Map<String, Object> listByParams(Long courseId, String name, String title);

    /**
     * 删除课程
     *
     * @param courseId
     * @param lessonId
     * @return
     */
    Map<String, Object> deleteCourse(Long courseId, Long lessonId);

    /**
     * 排序
     *
     * @param lessonId
     * @param sort       目标顺序
     * @param createUser
     * @return
     */
    Map<String, Object> sort(long lessonId, int sort, String createUser);
}
